<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bfl.ai/v1/flux-pro-1.0-expand",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'image' => '<string>',
'user' => '<string>',
'top' => 0,
'bottom' => 0,
'left' => 0,
'right' => 0,
'prompt' => 'ein fantastisches bild',
'steps' => 50,
'prompt_upsampling' => false,
'seed' => 123,
'guidance' => 60,
'output_format' => 'jpeg',
'safety_tolerance' => 2,
'webhook_url' => '<string>',
'webhook_secret' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}